<?php

namespace Common\Model;
use Common\Model\AllModel;

/**
 * 订单表主表，保存全部的订单信息
 * 
 * @author xiaoyutab<xiaoyutab@qq.com>
 * @version v1.0.0
 * @copyright (c) 2017, xiaoyutab
 * @adtime 2018-06-22 23:32:52
 */
class OrderModel extends AllModel{
    protected $_status = [
        1 => '待支付',
        2 => '待回调确认',
        3 => '已确认支付',
        4 => '支付失败',
        5 => '已回复',
        6 => '后台确认支付',
        97 => '已忽略',
        98 => '已删除',
        99 => '已完成',
    ];


    /**
     * 获取状态详情
     * 
     * @param type $status
     * @return type
     */
    public function get_status($status = false){
        if($status){
            return $this->_status[$status]?$this->_status[$status]:'未知状态';
        }
        return $this->_status;
    }
    
    /**
     * 获取可以进行退款的工单状态
     * @return type
     */
    public function get_status_reback(){
        return [3,6,99];
    }
}